Speed up `describe-char` when a property has a large value
authorStefan Monnier <monnier@iro.umontreal.ca>
Thu, 21 Mar 2024 16:28:54 +0000 (12:28 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 21 Mar 2024 16:28:54 +0000 (12:28 -0400)
commite819413e24d81875abaf81c281115e695ad5cc28
treef454acc374805ddc4ee64adaecbb9f592eaa4f3d
parent129bc91a2c9b7a6e314b4a5a4c60c266ca1cac0f
Speed up `describe-char` when a property has a large value

Doing `C-u C-x =` on a buffer position where the overlay/text
properties hold large values (e.g. inside the profiler report)
can be surprisingly slow because it pretty prints all those properties.
Change the code to do the pretty printing more lazily.
While at it, share that duplicated code between `descr-text.el` and
`wid-browse.el`.

* lisp/emacs-lisp/pp.el (pp-insert-short-sexp): New function.

* lisp/descr-text.el (describe-text-sexp): Delete function.
(describe-property-list): Use `pp-insert-short-sexp` instead.

* lisp/wid-browse.el (widget-browse-sexp): Use `pp-insert-short-sexp`
and `widget--allow-insertion`.
lisp/descr-text.el
lisp/emacs-lisp/pp.el
lisp/wid-browse.el